#ifndef KTEXTEDIT_H
#define KTEXTEDIT_H

#include <QTextEdit>
#include "ktag.h"
#include <QLineEdit>
#include "klabel.h"
#include "../screencapsdk_global.h"

namespace kdk {

/**
 * @defgroup @DialogBoxModule
 */

class KTextEditPrivate;

/**
 * @brief 继承QTextEdit
 * @since 2.4
 */
class SCREENCAPSDK_EXPORT KTextEdit :public QTextEdit
{
    Q_OBJECT
public:
    KTextEdit(QWidget *parent = nullptr);

    /**
     * @brief 设置label是否可见
     * @param flag
     */
    void setLabelVisible(bool flag);

    /**
     * @brief 设置图标
     * @param pixmap
     */
    void setPixmap(const QPixmap &pixmap);

    /**
     * @brief 获取图标
     * @return
     */
    const QPixmap *pixmap() const;

    /**
     * @brief 设置label文本
     * @param text
     */
    void setLabelText(const QString &text);

    /**
     * @brief 设置是否可编辑状态
     * @param ro
     */
    void setReadOnly(bool ro);

protected:
    void paintEvent(QPaintEvent* event);

private:
    Q_DECLARE_PRIVATE(KTextEdit)
    KTextEditPrivate* const d_ptr;

};

}
#endif // KTEXTEDIT_H
